/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.namabank.exception;

import org.json.JSONException;
import org.json.JSONObject;

/**
 *
 * @author Nguyen Tran Hien
 */
public class CheckValidate {
    public static boolean isNullOrEmpty(String vari, String variName, JSONObject res) throws JSONException{
        if (vari == null || vari.length() == 0){
            res.put("error_name", "data_invalid");
            res.put("error_type", "null_or_empty");
            res.put("error_variable", variName);
            return true;
        }
        return false;
    }
}
